package com.xidian.zhiancloud.dao.syset.usermanage;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xidian.zhiancloud.model.syset.Organization;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 组织机构
 */
public interface OrganizationMapper extends BaseMapper<Organization> {

    Organization selectByNameAndOrglevelid
        (@Param("companyId") Long companyId,
        @Param("name")String name,
        @Param("orglevelid")Integer orglevelid);

    int addOrgMessage(@Param("org") Organization org);

    Organization selectByName(@Param("companyId") Long companyId,
                              @Param("name")String name);

    Organization selectByIdAndCompanyId(@Param("companyId") Long companyId,
                   @Param("id") Long id);

    List<Organization> getById(@Param("companyId") Long companyId,
                               @Param("id") String id);

    Organization getByIsafeorg(@Param("companyId") Long companyId);

    Organization getByTopPid(@Param("companyId") Long companyId);

    List<Organization> getByLeadUserid
         (@Param("companyId") Long companyId,List<String> orgList);

    int deleteOrg(List<String> list);

    int updateOrgMessage(@Param("id") String id,@Param("org") Organization org);

    Organization getByPidAndLeadUserId(@Param("companyId") Long companyId,
                                       @Param("id") Long id);


}
